package com.hema.auction.widget;

import android.content.Context;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

import com.hema.auction.R;

/**
 * 描述:
 * 作者:john
 */
public class MyClickable extends ClickableSpan implements View.OnClickListener {
    private View.OnClickListener listener;
    private Context context;

    public MyClickable(Context context, View.OnClickListener listener) {
        this.context = context;
        this.listener = listener;
    }


    @Override
    public void onClick(View v) {
        listener.onClick(v);
    }


    @Override
    public void updateDrawState(TextPaint ds) {
        super.updateDrawState(ds);
        ds.setColor(context.getResources().getColor(R.color.colorPrimary));//设置字体颜色
        ds.setUnderlineText(false);
    }
}
